package method_student;

public class MethodDemo04 {
    //单个数和数组传递的不同
    //定义单个数的方法
    public static void change(int a){
        System.out.println( "change1:" + a);
        a = 20;
        System.out.println("change2:" + a);
    }
     //定义数组的方法
    public static void change1(int[] arrs){
        System.out.println("change1.1:" + arrs[2]);
        arrs[2] = 222;
        System.out.println("change1.2:" + arrs[2]);

    }
    //调用方法
    public static void main(String[] args) {
        int a = 10;
        change(a);
        System.out.println("main:" + a);
        int[] arrs = {21, 22, 23};
        change1(arrs);
        System.out.println("main1:" + arrs[2]);
    }
}
